<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const p = new Promise((resolve, reject) => {
      // resolve===成功===函数
      // reject====失败====函数
      /* 如果 执行resolve又执行reject 谁在前面就走谁 */
      resolve(2)
      reject(1)
    })
    console.log(p, 8888);
    p.then(res => {
      console.log(res, 1111);
    }).catch(err => {
      console.log(err, 222);
    })
  </script>
</body>

</html>


<!-- 重绘和回流 -->
<!-- 重绘和重排 -->

<!-- 重绘：不影响dom结构  color:red
回流或者重排：会影响结构======定位、元素添加和移除 -->